<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

	<title>Instagram ${category} Brand Ranking | GugeeData</title>
	<meta name="description" content="The ranking of ${category} brand whose related media posts are most engaging. | GugeeData">
	<meta name="keywords" content="Instagram Brand, Influencer Marketing, Instagram Marketing">
	<meta property="og:title" content="Instagram 分类 Brand Ranking | GugeeData">
	<meta property="og:description" content="The ranking of ${category} brand whose related media posts are most engaging. | GugeeData">
	<meta property="og:type" content="website">
    <#if category == ''>
		<meta property="og:url" content="https://www.gugeedata.com/instagram/brand-ranking">
    <#else>
		<meta property="og:url" content="https://www.gugeedata.com/instagram/${category}-brand-ranking">
    </#if>
	<meta property="og:image" content=" https://seo-imags.s3.us-east-2.amazonaws.com/Logo.png">
	<meta name="twitter:title" content="Instagram ${category} Brand Ranking | GugeeData">
	<meta name="twitter:description" content="The ranking of ${category} brand whose related media posts are most engaging. | GugeeData">

	<link rel="icon" href="${request.contextPath}/static/img/favicon.ico" type="image/x-icon"/>
	<link rel="shortcut icon" href="${request.contextPath}/static/img/favicon.ico" type="image/x-icon"/>
	<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@500&display=swap" rel="stylesheet">
	<link rel="stylesheet" href="${request.contextPath}/static/plugins/layui/layui.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/ins/common.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/ins/rank.css">
	<link rel="stylesheet" href="${request.contextPath}/static/css/ins/rank-brand.css">

    <#include "../../../component/facebookPixel.ftl">
</head>
<body>
<#include "../../../header_new1.ftl">
<main>
	<section>
		<div class="container">
			<h1>Instagram ${category} Brand Leaderboard</h1>
			<h2>The ranking of ${category} brand whose related media posts are most engaging.</h2>
		</div>
	</section>
	<section>
		<div class="container is-pc">
			<div class="export-row">
				<div class="gd-btn-group">
					<div class="gd-btn is-active">Daily</div>
					<div class="gd-btn">Weekly</div>
					<div class="gd-btn">Monthly</div>
				</div>
				<div class="gd-select">
					<div class="gd-select-title">
						<div class="label"></div>
						<i class="iconfont icondown1"></i>
					</div>
					<div class="gd-select-wrap">
						<ul id="dateDayList"></ul>
						<ul id="dateWeekList" style="display: none"></ul>
						<ul id="dateMonthList" style="display: none"></ul>
					</div>
				</div>
				<button class="gd-btn btn-info" id="exportBtn">Export</button>
                <#setting datetime_format="MM-dd-yyyy HH:mm"/>
				<div class="flex-right">Data Updated： ${updateTime?number_to_datetime} UTC</div>
			</div>
			<div class="search-row">
				<div class="search-item">
					<div class="label">Brand Category :</div>
					<div class="search-wrap">
						<ul id="categoryList">
							<li <#if category == ''>class="is-active"</#if>>All</li>
							<#list categories as item>
								<li <#if category == item.commercialCategory>class="is-active"</#if> value="${item.commercialCategory}">
                                    ${item.commercialCategory}
								</li>
							</#list>
						</ul>
					</div>
				</div>
			</div>
			<div class="tab-wrap">
				<table class="ins-table">
					<thead>
					<tr>
						<th width="120">Rank</th>
						<th align="left" width="400">Brand Info</th>
						<th width="130">
							<div class="gd-popover"
							     content="The number of media posts tagged/mentioned the brand<br>or product of the brand and the media posted by<br>the brand official accounts in the selected period.">
								Post
								<i class="iconfont iconfaq"></i>
							</div>
						</th>
						<th width="130">
							<div class="gd-popover"
							     content="The number of likes on all the brand related<br>media posts in the selected period.">
								Likes
								<i class="iconfont iconfaq"></i>
							</div>
						</th>
						<th width="130">
							<div class="gd-popover"
							     content="The number of reviews on all the brand related<br>media posts in the selected period.">
								Reviews
								<i class="iconfont iconfaq"></i>
							</div>
						</th>
						<th width="160">
							<div class="gd-popover"
							     content="The number of likes and reviews on all the brand<br>related media posts in the selected period.">
								Engagements
								<i class="iconfont iconfaq"></i>
							</div>
						</th>
						<th>Action</th>
					</tr>
					</thead>
                    <#if listData.list?size gt 0>
	                    <tbody>
                        <#list listData.list as item>
							<tr>
								<td class="td-inx">
									<div class="td-inx__inner">
										<div class="tb-inx">${item.rank}</div>
									</div>
								</td>
								<td>
									<div class="td-info">
										<div class="avatar">
                                            <#assign logo=myController.getNoExpiredImage(item.logo, 1, 0)>
											<img width="48" height="48" src="${logo}" alt="brand image">
										</div>
										<div class="brand-info">
											<div class="title" title="${item.enName}">
												${item.enName}
											</div>
                                            <#if item.categoryName??>
												<div class="sub-title category">
	                                                ${item.categoryName}
												</div>
                                            </#if>
										</div>
									</div>
								</td>
                                <#if item.mediaCount??>
                                    <#assign mediaCount=myController.getNumber(item.mediaCount)>
									<td>${mediaCount}</td>
                                <#else>
									<td>0</td>
                                </#if>
                                <#if item.likeCount??>
                                    <#assign likeCount=myController.getNumber(item.likeCount)>
									<td>${likeCount}</td>
                                <#else>
									<td>0</td>
                                </#if>
                                <#if item.reviewCount??>
                                    <#assign reviewCount=myController.getNumber(item.reviewCount)>
									<td>${reviewCount}</td>
                                <#else>
									<td>0</td>
                                </#if>
                                <#if item.engagements??>
                                    <#assign engagements=myController.getNumber(item.engagements)>
									<td>${engagements}</td>
                                <#else>
									<td>0</td>
                                </#if>
								<td>
									<div class="td-action">
										<div class="gd-popover" content="Analyze">
											<div class="blue">
												<a href="/instagram/brand/${item.enName}" target="_blank">
													<i class="iconfont iconxiangqing"></i>
												</a>
											</div>
										</div>
									</div>
								</td>
							</tr>
                        </#list>
	                    </tbody>
                    <#else>
	                    <tbody>
							<tr>
								<td colspan="7">
									<div class="no-data">
										<img width="132" height="131" src="/static/img/ins/noData.png" alt="">
										<div class="title">No related data available</div>
									</div>
								</td>
							</tr>
						</tbody>
                    </#if>
				</table>
			</div>
			<div class="pagination" id="pagination"></div>
		</div>
		<div class="container is-mobile">
			<div class="sort-list">
				<div class="sort-item">
					Daily
					<i class="iconfont icondown1"></i>
				</div>
				<div class="sort-item">
					<i class="iconfont icondown1"></i>
				</div>
				<div class="sort-item">
					<span class="label">Categories</span>
					<i class="iconfont icondown1"></i>
				</div>
			</div>
			<div class="filter-wrap">
				<div class="filter-wrap__inner">
					<div class="sort-list">
						<div class="sort-item">
							Daily
							<i class="iconfont icondown1"></i>
						</div>
						<div class="sort-item">
							<i class="iconfont icondown1"></i>
						</div>
						<div class="sort-item">
							<span class="label">Categories</span>
							<i class="iconfont icondown1"></i>
						</div>
					</div>
					<ul id="sortDateType" style="display: none">
						<li style="display: block; padding: 0">
							<div class="gd-btn-select">
								<ul class="btn-select">
									<li class="btn-select-item is-active" value="0">Daily</li>
									<li class="btn-select-item" value="1" >Weekly</li>
									<li class="btn-select-item" value="2">Monthly</li>
								</ul>
							</div>
						</li>
					</ul>
					<ul id="sortDateDay" style="display: none"></ul>
					<ul id="sortDateWeek" style="display: none"></ul>
					<ul id="sortDateMonth" style="display: none"></ul>
					<ul id="sortCategory" style="display: none">
						<#if category == ''>
							<li class="is-active">
								All
								<div class="right"><i class="iconfont iconzhichi"></i></div>
							</li>
						<#else>
							<li>All</li>
						</#if>
                        <#list categories as item>
                            <#if category == item.commercialCategory>
	                            <li class="is-active" value="${item.commercialCategory}">
                                    ${item.commercialCategory}
		                            <div class="right"><i class="iconfont iconzhichi"></i></div>
	                            </li>
                            <#else>
	                            <li value="${item.commercialCategory}">
                                    ${item.commercialCategory}
	                            </li>
                            </#if>

                        </#list>
					</ul>
				</div>
			</div>
			<div class="tip-row">
				<div class="gd-popover"
				     content="<dl class='modal-tip'>
							<dt>1. Post</dt>
							<dd>The number of media posts tagged/mentioned the brand or product of the brand, and the media posted by the brand official accounts in the selected period.</dd>
							<dt>2. Likes</dt>
							<dd>The number of likes on all the brand related media posts in the selected period.</dd>
							<dt>3. Reviews</dt>
							<dd>The number of reviews on all the brand related media posts in the selected period.</dd>
							<dt>4. Engagements</dt>
							<dd>The number of likes and reviews on all the brand related media posts in the selected period.</dd>
						</dl>">
					Tip
					<i class="iconfont iconfaq"></i>
				</div>
			</div>
			<div class="gd-mobile-list">
				<div class="gd-mobile-list__wrap">
                    <#if listData.list?size gt 0 >
                        <#list listData.list as item>
							<a href="/instagram/brand/${item.enName}">
								<div class="user-item">
									<div class="user-info">
										<div class="avatar">
                                            <#assign logo=myController.getNoExpiredImage(item.logo, 1, 0)>
											<img class="head" width="48" height="48" src="${logo}" alt="brand logo">
										</div>
										<div class="user-title">
											<div class="top">
												<div class="title">${item.enName}</div>
											</div>
											<#if item.categoryName??>
												<div class="bottom category">${item.categoryName}</div>
											</#if>
										</div>
										<div class="user-rank">
                                            ${item.rank}
										</div>
									</div>
									<div class="user-data">
										<div class="data-item">
											<div class="label">Post</div>
                                            <#if item.mediaCount??>
                                                <#assign mediaCount=myController.getNumber(item.mediaCount)>
												<div class="num">${mediaCount}</div>
                                            <#else>
												<div class="num">0</div>
                                            </#if>
										</div>
										<div class="data-item">
											<div class="label">Likes</div>
                                            <#if item.likeCount??>
                                                <#assign likeCount=myController.getNumber(item.likeCount)>
												<div class="num">${likeCount}</div>
                                            <#else>
												<div class="num">0</div>
                                            </#if>
										</div>
										<div class="data-item">
											<div class="label">Reviews</div>
                                            <#if item.reviewCount??>
                                                <#assign reviewCount=myController.getNumber(item.reviewCount)>
												<div class="num">${reviewCount}</div>
                                            <#else>
												<div class="num">0</div>
                                            </#if>
										</div>
										<div class="data-item">
											<div class="label">Engagements</div>
                                            <#if item.engagements??>
                                                <#assign engagements=myController.getNumber(item.engagements)>
												<div class="num">${engagements}</div>
                                            <#else>
												<div class="num">0</div>
                                            </#if>
										</div>
									</div>
								</div>
							</a>
                        </#list>
                    <#else>
						<div class="no-data">
							<img width="132" height="131" src="/static/img/ins/noData.png"
							     alt="no data"
							     srcset="/static/img/ins/noData@2x.png 2x, /static/img/ins/noData@3x.png 3x">
							<div class="title">No related data available</div>
						</div>
                    </#if>
				</div>
				<div class="gd-mobile-list__footer">
                    <#if login != false>
	                    <#if listData.list?size gt 0>
		                    <div class="rotate"><i class="iconfont icongengxin"></i></div>
		                    <span class="list-footer-tx" style="display: none">You have reached the end.</span>
	                    </#if>
                    <#else>
						<a href="javascript:;" class="link-login">
							View More
						</a>
                    </#if>
				</div>
			</div>
		</div>
	</section>
</main>
<#if isMobile == false>
    <#include "../../../footer_new.ftl">
	<script src="${request.contextPath}/static/plugins/layui/layui.js" charset="utf-8"></script>
</#if>
<script src="${request.contextPath}/static/js/gd-ui/popover/index.js"></script>
<script src="${request.contextPath}/static/js/nums.js"></script>
<script src="${request.contextPath}/static/js/scroll.js"></script>
<script>
    const params = {
        pageSize: 10,
        page: 1,
        rankType: 0,
        categoryName: '${category}',
    }
    <#if isMobile == false>
    let totalRow = +${listData.totalRow?c}
    <#else>
    let hasData = true
    </#if>
</script>
<script type="module">
	import CommonRank from "/static/component/rank/commonRank.js"

	const commonRank = new CommonRank()
    commonRank.setDateUrl('/ins/brand/rank/dates')
	commonRank.setExportUrl('/ins/brand/rank/export')
    commonRank.setRankUrl('brand-ranking')
	commonRank.setRankList(getRankList)
    commonRank.initRender()

	function getRankList() {
        if(params.categoryName === 'All') {
            params.categoryName = undefined
        }
        let wrap, url = getEncodeUrl('/ins/brand/rank', params)
        if(gugeeGobal.isMobile) {
            wrap = document.querySelector('.gd-mobile-list__wrap')
        } else {
            wrap = document.querySelector('.ins-table tbody')
        }
        wrap.showLoading()

        commonRank.getList(wrap, url, list => {
            let str = ''
            if(gugeeGobal.isMobile) {
                list.forEach(item => {
                    str += '<a href="/instagram/brand/' + item.enName + '">' +
                        '<div class="user-item">' +
                        '<div class="user-info">' +
                        '<div class="avatar">' +
                        '<img class="head" width="48" height="48" src="' + getImage(item.logo, IMAGE_TYPE.MEDIA, IMAGE_SIZE.SMALL) + '" alt="brand logo">' +
                        '</div>' +
                        '<div class="user-title">' +
                        '<div class="top">' +
                        '<div class="title">' + item.enName + '</div>' +
                        '</div>'
	                if(item.categoryName) {
	                    str += '<div class="bottom category">' + item.categoryName + '</div>'
	                }
	                str += '</div>' +
                        '<div class="user-rank">' + item.rank + '</div>'
                    str += '</div>' +
                        '<div class="user-data">' +
                        '<div class="data-item">' +
                        '<div class="label">Post</div>' +
                        '<div class="num">' + numFormat(+item.mediaCount) +'</div>' +
                        '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">Likes</div>' +
                        '<div class="num">' + numFormat(+item.likeCount) + '</div>' +
                        '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">Reviews</div>' +
                        '<div class="num">' + numFormat(+item.reviewCount) +'</div>' +
                        '</div>' +
                        '<div class="data-item">' +
                        '<div class="label">Engagements</div>' +
                        '<div class="num">' + numFormat(+item.engagements) +'</div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '</a>'
                })
            } else {
                list.forEach(item => {
                    str += '<tr>' +
                        '<td class="td-inx">' +
                        '<div class="td-inx__inner">' +
                        '<div class="tb-inx">' + item.rank + '</div>'
                    str += '</div>' +
                        '</td>' +
                        '<td>' +
                        '<div class="td-info">' +
                        '<div class="avatar">' +
                        '<img width="48" height="48" src="' + getImage(item.logo, IMAGE_TYPE.MEDIA, IMAGE_SIZE.SMALL) + '" alt="product image">' +
                        '</div>' +
                        '<div class="brand-info">' +
                        '<div class="title" title="' + item.enName + '">' + item.enName + '</div>'
	                if(item.categoryName) {
	                    str += '<div class="sub-title category">' + item.categoryName + '</div>'
	                }
	                str += '</div>' +
                        '</div>' +
                        '</td>' +
                        '<td>' + numFormat(+item.mediaCount) + '</td>' +
                        '<td>' + numFormat(+item.likeCount) + '</td>'+
                        '<td>' + numFormat(+item.reviewCount) + '</td>'+
                        '<td>' + numFormat(+item.engagements) + '</td>'+
                        '<td>' +
                        '<div class="td-action">' +
                        '<div class="gd-popover" content="Analyze">' +
                        '<div class="blue">' +
	                        '<a href="/instagram/brand/' + item.enName + '" target="_blank">' +
	                        '<i class="iconfont iconxiangqing"></i>' +
	                        '</a>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '</td>' +
                        '</tr>'
                })
            }
            return str
        })
    }
</script>
</body>
</html>